$(function () {
   $("#jqGrid").jqGrid({
        url: '../search/crosslist',
        datatype: "json",

        colModel: [			
		
			{ label: '标签编号', name: 'code_tag', width: 80 }, 			
	
			{ label: '人员名称', name: 'username', width: 80 }, 			
			{ label: '基站编号', name: 'code_station', width: 80 }, 			
			{ label: '基站名称', name: 'name_station', width: 80 },
			{ label: '开始时间', name: 'begintime', width: 80 }, 			
			{ label: '最后时间', name: 'lasttime', width: 80 },
			{ label: '离开时间', name: 'leavetime', width: 80 }, 			
			{ label: '备注', name: 'conclusion', width: 80 }
        ],
		viewrecords: true,
		 height: 'auto',
        rowNum: 10,
		rowList : [10,30,50],
        rownumbers: true, 
        rownumWidth: 25, 
        autowidth:true,
        multiselect: true,
        pager: "#jqGridPager",
        jsonReader : {
            root: "pageUtil.list",
            page: "pageUtil.currPage",
            total: "pageUtil.totalPage",
            records: "pageUtil.totalCount",
            repeatitems:false
        },
        prmNames : {
            page:"page", 
            rows:"limit", 
            order: "order"
        },
        gridComplete:function(){
        	//隐藏grid底部滚动条
        	$("#jqGrid").closest(".ui-jqgrid-bdiv").css({ "overflow-x" : "hidden" }); 
        }
    });
	
});
var type;
function show_sub(v){
	type=v;
}
var search=document.getElementById("search");
search.onclick=function(){
	var page = $("#jqGrid").jqGrid('getGridParam','page');
	$("#jqGrid").jqGrid('setGridParam',{
		  postData:{'type': type,'val':$("#val").val(),'dtFrom':$("#d4311").val(),'dtTo':$("#d4312").val()},
        page:page
    }).trigger("reloadGrid");
};
function t(){  
	var type=$("#liebiao").val();
    var val=$("#val").val(); //可以是一个可变的值  
    var dtFrom=$("#d4311").val(); //可以是一个可变的值  
    var dtTo=$("#d4312").val(); //可以是一个可变的值  
    
    document.getElementById("n").href="../search/excel?type="+type+"&val="+val+"&dtFrom="+dtFrom+"&dtTo="+dtTo+"";
}

